Components
Advanced circuitry components are special redstone devices that use a special, custom programming interface to not only allow programmers much more control of how, when and where energy shall flow but also enable players to set up compact and complex circuits. Components can react to anything, including internal circuit calls and block events. The components API is broad enough to provide a lot of customization to standardized algorithms much like the Vanilla mechanisms. Logic There are three basic types of components: #Source #Regular component #Destination Source components These special types of components will be considered power providers as long as they are sufficiently powered, i.e. lead more than 0.2 power units. Just like regular components, they can be full or custom design blocks. A component can be both Source and Destination, though there is no special treatment for components that are also "regular" components. In fact, on the programming side both types are interfaces that extend the regular components' interface. Regular components These are the core of the advanced circuits. Most components are based on the standard cables. They lead the power through the circuit in an efficient manner. By default, power propagated through one block of cable will lose 0.5% of its total power. Since even this behavior can be customized, see the individual component pages for more information. Destination components These are considered "the end of the line" for power propagation. A source that is also a destination will primarily act as source. If powered by components after propagation has begun it will behave like a destination. Internal propagation will no longer proceed in this direction. Power propagation on the programming side Having been the most challenging part of the advanced circuitry, propagation can begin at any component. Though in order for it to work, so-called "power sides" must have been previously set. Thus only sources can initiate the power within a circuit. The "propagation sides" are used if no power sides are given which in the most common case is when a circuit has been turned off or one component has been disconnected from another. Both terms are saved in the component data accessible through the CircuitManager singleton and should not be tampered. If a regular component is found that leads the power in two or more directions and there is another component in these directions, then the power will be divided equally among all "branches". If a component is receiving power from more than a single side, then all power will be added together and handed over to that particular component allowing for more customized reaction. A component may decide itself where to save its power: metadata, TileEntity, ComponentData, or something entirely different. Propagation of power is not interrupted when a component does not further provide power to other components. At this time, propagation still continues in order to turn off every succeeding component if applicable. This is where the propagation sides are mainly used. This was necessary to fix a bug that would not properly propagate power within circular circuits, for example the XOR-Gate. Components Currently there are 6 components: *Redstone Converter *Keyhole *Redstone Cable *Switch (initially opened and closed) *Diode *Coil The coil is currently in development and will be available soon as the advanced circuitry counterpart of the redstone repeater. Development will proceed to finally support multiplayer gaming. Afterwards I will work on piston support: all components based off the cable that utilize our custom InvisibleTileEntity API will support being pushed by both regular and sticky pistons. A more programmatic approach to circuitry will be taken once crystals can be used with them by adding the ability to filter elemental current to each component. The diode will be extended to provide a GUI.